package 内部类;

public class Test {
    public static void main(String[] args) {
        System.out.println(new Outer().name);  //链式编程
        Outer out = new Outer();
        System.out.println(out.name);

        //内部类
        Outer.Inner oi = new Outer().new Inner();//1.
        //对于private修饰的私有类
        System.out.println(out.getInstance());
//        Object inn = out.getInstance();
        oi.show();
        //inn 没有子类的虚方法表，无法调用子类的方法，（重写除外）！(强行转换)

        //强转(绕过private 创建对象)
        Outer.Inner innt = (Outer.Inner) out.getInstance();
        innt.show();

    }
}
